<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        arr = [1, 5, 3]
        Array.prototype.myReverse = function () {
            for (let i = 0; i < this.length - 1; i++) {
                for (let j = 0; j < this.length - i - 1; j++) {
                    let temp = arr[j]
                    arr[j] = arr[j + 1]
                    arr[j + 1] = temp
                }
            }
            return this
        }
        console.log(arr.myReverse());
    </script>
</body>

</html>